package com.example.service;

import com.example.dao.MenuDao;
import com.example.entity.menu;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Service
@Transactional
public class MenuServiceImpl implements MenuService {

      private MenuDao menuDao;

      public MenuServiceImpl(MenuDao menuDao) {
            this.menuDao = menuDao;
      }

      @Override
      public void save(menu menu) {
            menuDao.save(menu);
      }

      @Override
      public List<menu> findAllMenus(String shopID) {
            return menuDao.findAllMenus(shopID);
      }

      @Override
      public menu findMenuByID(Integer idpic) {
            return menuDao.findMenuByID(idpic);
      }

      @Override
      public void deleteMenuByID(Integer idpic) {
            menuDao.deleteMenuByID(idpic);
      }

      @Override
      public void updatePrice(menu menu) {
            menuDao.updatePrice(menu);
      }

      @Override
      public List<menu> findAllMenu() {
            return menuDao.findAllMenu();
      }
}
